﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Routing;

namespace MyClub.Web.Handlers
{
    /// <summary>
    /// Defines the base class for ~/Handlers/Category.aspx.
    /// </summary>
    public partial class Category : System.Web.UI.Page
    {
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsRouted())
            {
                RequestContext requestContext = Page.GetRequestContext();
                if (requestContext.RouteData.Values.ContainsKey("CategoryPath"))
                {
                    CategoryFeed.Attributes["href"] = requestContext.RouteData.Values["CategoryPath"] + "feed";
                }
                else
                {
                    CategoryFeed.Visible = false;
                }
            }
        }
    }
}
